focus
Type
command
Summary
Places the insertion point in a field, makes a control active, or removes focus from all controls.
Syntax
focus [on] <object>
focus on nothing
Description
Use the focus command to make a control active--that is, to make it receive any keystrokes the user types.
If the object's traversalOn property is false, it cannot receive the focus, and the focus command causes an error.
If the lookAndFeel is set to "Motif", the active control|focused control is outlined, and the control receives any keystrokes (and the messages associated with them).
If the lookAndFeel is set to "Appearance Manager" or "Macintosh", an outline is drawn around fields, images, and EPS objects whose showFocusBorder property is set to true. Otherwise, the appearance of the focused control does not change, but it receives keystroke messages.
If the lookAndFeel is set to "Windows 95", a dotted outline is drawn within buttons when they receive the focus.
If the object is an unlocked field, the insertion point is restored to the location at which it was located the last time the field was focused. If the field was not previously focused, then the insertion point is placed at the beginning of the text in the field.
Use the focus on nothing
command to remove focus from all objects on
a card.
Parameters
Name | Type | Description |
---|---|---|
object | Any object on the current card. |
Examples
focus on field 1
focus on the mouseControl
focus on graphic "Move Me"
focus on nothing
Related
function: focusedObject, mouseStack
glossary: property, EPS, error, insertion point, message, unlock, appearance, active control, command
keyword: control
message: enterKey, focusIn, keyUp, tabKey, mouseLeave, mouseWithin, keyDown, focusOut, returnKey
property: focusPattern, showFocusBorder, lockText, selected, lookAndFeel, focusColor, traversalOn
Compatibility and Support
Introduced
LiveCode 1.0
OS
mac
windows
linux
ios
android
Platforms
desktop
server
mobile